package com.hgyc.mom.wms.entity;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.*;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.hgyc.mom.common.annotation.Excel;
import com.hgyc.mom.core.annotation.DictColumn;
import com.hgyc.mom.core.annotation.TableDict;
import com.hgyc.mom.core.mybatis.EQ;
import com.hgyc.mom.core.mybatis.Like;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

/**
 * <p>
 * 采购订单
 * </p>
 *
 * @author fwj
 * @since 2025-05-15
 */
@Data
@TableName("scm_purchase_order")
@Schema(name="采购订单对象", description="采购订单对象")
public class ScmPurchaseOrder implements Serializable {
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @Schema(description = "")
    private Long id;

    @Excel(name = "订单编码")
    @EQ
    @Schema(description = "订单编码")
    private String poCode;

    @Excel(name = "订单类型")
    @EQ
    @Schema(description = "订单类型")
    private String poType;

    @Excel(name = "供应商")
    @EQ
    @Schema(description = "供应商")
    @TableDict(table = "base_supplier", key = "id", columns = {
            @DictColumn(name = "supplier_name", alias = "supplierName")
    })
    private Long supplierId;

    @Excel(name = "订单状态")
    @EQ
    @Schema(description = "订单状态")
    private String status;

    @Excel(name = "订单日期")
    @EQ
    @Schema(description = "订单日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate orderDate;

    @Excel(name = "交货日期")
    @Schema(description = "交货日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate deliveryDate;

    @Excel(name = "进度")
    @Schema(description = "进度")
    private BigDecimal schedule;

    @Excel(name = "采购员")
    @Schema(description = "采购员")
    @TableDict(table = "sys_user", key = "id", columns = {
            @DictColumn(name = "name", alias = "buyerName")
    })
    private Long buyer;

    @Excel(name = "备注")
    @Schema(description = "备注")
    private String remark;

    @TableField(fill = FieldFill.INSERT)
    @Schema(description = "")
    private Long createBy;

    @TableField(fill = FieldFill.INSERT)
    @Schema(description = "")
    private LocalDateTime createTime;

    @TableField(fill = FieldFill.UPDATE)
    @Schema(description = "")
    private Long updateBy;

    @TableField(fill = FieldFill.UPDATE)
    @Schema(description = "")
    private LocalDateTime updateTime;

}